package ProjectXXX;

import java.net.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
import module4.*;
import java.util.Vector;


public void generateStockId()
{
	try
	{
		Statement stockIdGeneratorSTMT = Conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
		ResultSet stockIdGeneratorRS;
		String stockIdGeneratorQUERY = "SELECT stockId FROM stockTable";
		
		stockIdGeneratorRS = stockIdGeneratorSTMT.executeQuery(stockIdGeneratorQUERY);
		
		stockIdGeneratorRS.last();
		String lastId = stockIdGeneratorRS.getString(1);
		String tempId = lastId.subString(2);
		int incrementer = Integer.parseInt(tempId);
		incrementer++;
		String uniqueId = new String("si"+incrementer);
		
		
	}
	catch(SQLException sqlE)
	{
		sqlE.printStackTrace();
	}	
	
	
}//end generateStockId()